home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / rpgedi1a / modgame.bas < prev    next >
BASIC Source File  |  1999-09-08  |  3KB  |  61 lines

  1. Attribute VB_Name = "modGame"
  2. 'The BitBlt function allows for fast and smooth drawing to the form
  3. 'and to picture boxes, but isn't as fast as it should be for making games.
  4. 'It stands for bit-block transfer.
  5. Public Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal animX As Long, ByVal animY As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
  6.  
  7. 'same as bitblt, but allows stretching.
  8. Public Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
  9.  
  10. 'allows the playing of wav files
  11. Public Declare Function sndPlaySound Lib "winmm" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
  12.  
  13. 'for the bitblt function
  14. Public Const SRCCOPY = &HCC0020   'Copies the source over the destination
  15. Public Const SRCINVERT = &H660046 'Copies and inverts the source over the destination
  16. Public Const SRCAND = &H8800C6    'Adds the source to the destination
  17.  
  18. 'holds the tile type for each tile (0 = walkable, 1 = non walkable, 2 = door)
  19. Public Walkable(0 To 899) As Integer
  20. 'holds the texture number for each tile
  21. Public Texture(0 To 899) As Integer
  22. 'holds the location of the top left corner of each tile
  23. Public tileLeft(0 To 899) As Integer
  24. Public tileTop(0 To 899) As Integer
  25. 'these hold the location of the map a tile with a walkable value of 2 leads to
  26. Public mapXStored(0 To 899) As Integer
  27. Public mapYStored(0 To 899) As Integer
  28. Public mapAreaStored(0 To 899) As String
  29.  
  30. 'shows whether the game has started or not
  31. Public GameInProgress As Boolean
  32.  
  33. Public Character As New clsHero
  34.  
  35. 'these are for changing the game speed
  36. Public Speed As Integer    'holds the current speed
  37. Public wait As Double      'holds the delay value
  38.  
  39. Public sndStep As String
  40. Public sndButton As String
  41.  
  42. 'symbolic constants - makes code easier to read
  43. Public Const MAGE = 1
  44. Public Const WARRIOR = 2
  45. Public Const BARBARIAN = 3
  46. Public Const CLARIC = 4
  47.  
  48. Public Const STR = 0
  49. Public Const STA = 1
  50. Public Const MAG = 2
  51. Public Const INTEL = 3
  52. Public Const VITAL = 4
  53.  
  54. 'for buttons
  55. Public Const CANCEL = 0
  56. Public Const OK = 1
  57.  
  58. Public Function msg(ByVal message As String, ByRef callingFrm As Form)
  59.     Call frmMessage.showMessage(message, callingFrm)
  60. End Function
  61.